package com.shiro.receiver.handler.dispatch;

import com.alibaba.fastjson2.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import com.shiro.receiver.entity.Payload;
import com.shiro.receiver.entity.req.GroupProactivelyMessageReceiveReqData;
import com.shiro.receiver.framework.constant.BotEventType;

@Slf4j
@Component
@RequiredArgsConstructor
public class GroupProactivelyMessageReceiveEventHandler extends DispatchEventHandler {

    @Override
    public void handle(Payload<JSONObject> payload) {
        GroupProactivelyMessageReceiveReqData data = payload.getData().toJavaObject(GroupProactivelyMessageReceiveReqData.class);
        log.info("[收到群聊开启主动消息事件] [Content:{}]", JSONObject.toJSONString(data));
    }

    @Override
    public BotEventType getEventType() {
        return BotEventType.GROUP_MSG_RECEIVE;
    }

}
